<?php

/*
 * Niken Larasati
 * larasati.n@students.amikom.ac.id
 */

class penduduk extends CI_Controller{
    public function __construct() {
        parent::__construct();
    }
    
    function formpenduduk(){
        $this->template->load('halaman_v','formpenduduk_v');
    }
    
    function tambah(){ //diurutin form
        if($this->input->post('tambah') != NULL)
        {
            $data['nik'] = $this->input->post('nik');
            $data['nama'] = $this->input->post('nama');
            $data['tempat_lahir'] = $this->input->post('tmp_lahir');
            $data['tgl_lahir'] = $this->input->post('tgl_lahir');
            $data['jns_kel'] = $this->input->post('jk');
            $data['id_agama'] = $this->input->post('agama');
            $data['id_didik'] = $this->input->post('pdd');
            $data['id_kerja'] = $this->input->post('pekerjaan');
            $data['status_kw'] = $this->input->post('statuspk');
            $data['id_hubkel'] = $this->input->post('hubkel');
            $data['kewarganegaraan'] = $this->input->post('kwn');
            $data['gol_darah'] = $this->input->post('gol_darah');
            $data['nama_ayah'] = $this->input->post('nama_ayah');
            $data['nama_ibu'] = $this->input->post('nama_ibu');
            $data['no_kk'] = $this->input->post('kk');
            $data['tgl_nikah'] = $this->input->post('tgl_nikah');
            $data['tgl_cerai'] = $this->input->post('tgl_cerai');
            $data['no_paspor'] = $this->input->post('paspor');
            $data['no_kitas'] = $this->input->post('kitas');
            $data['status'] = $this->input->post('status');
            $data['no_suratnikah'] = $this->input->post('no_nikah');
            $data['no_suratcerai'] = $this->input->post('no_cerai');
            $data['no_telp'] = $this->input->post('no_telp');
            
            $this->load->model('umum_m');
            $this->umum_m->tambah('penduduk',$data);
            $this->template->load('halaman_v','laporan_penduduk_v');
        }
    }
    
    function ambil_data(){
        $this->load->model('penduduk_m');
        $data['data'] = $this->penduduk_m->ambil_data();
        $this->template->load('halaman_v','laporan_penduduk_v',$data);
    }
}



?>
